
#ifndef __BASIC_CONVERSION_TOOLS__
#define __BASIC_CONVERSION_TOOLS__


#include <sstream>
#include <string>


// taken from somewhere on StackOverflow

template <typename OutType> OutType fromString( const std::string& inString ) {

  std::istringstream stream(inString);
  OutType out;
  stream >> out;
  return out;
}


template <typename InType> std::string toString( const InType& in ) {

  std::ostringstream stream;
  stream << in;
  return stream.str();
}


#endif //  __BASIC_CONVERSION_TOOLS__

